package com.cxg.fairy.ec.main.personal.score;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.cxg.fairy.ec.main.personal.balance.BalanceListDelegate;

import java.util.ArrayList;

/**
 * Created by CFairy
 */

public class ScoreTabPagerAdapter extends FragmentStatePagerAdapter {

    private final ArrayList<String> TAB_TITLES = new ArrayList<>();

    public ScoreTabPagerAdapter(FragmentManager fm) {
        super(fm);
        TAB_TITLES.add("全部明细");
        TAB_TITLES.add("收入明细");
        TAB_TITLES.add("支出明细");
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 0) {
            return ScoreListDelegate.create(0);
        } else if (position == 1) {
            return ScoreListDelegate.create(1);
        }else if (position == 2) {
            return ScoreListDelegate.create(2);
        }
        return null;
    }

    @Override
    public int getCount() {
        return TAB_TITLES.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return TAB_TITLES.get(position);
    }
}
